﻿@model CMSInfoConfig
@{
    ViewBag.Title = "系统设置";
}

<section class="content-header">
    <h1>
        <a href="javascript:window.app.loadUI('@Url.Action("Index")')">设置</a>
    </h1>
    <ol class="breadcrumb">
        <li><a href="@Url.Action("Index", "Home")"><i class="fa fa-home"></i> 首页</a></li>
        <li class="">平台维护</li>
        <li class="active">系统设置</li>
    </ol>
</section>
<section class="content">
    <div class="row">
        <div class="col-lg-12 col-md-12">
            <div class="box box-primary">
                <div class="box-header with-border">

                </div>
                <div class="box-body no-padding">
                    <form id="settingForm" class="form-horizontal" data-validate="parsley" action="#">




                        <div class="form-group">
                            <div class="col-sm-3 control-label">
                                @Html.LabelFor(m => m.Address, "通讯地址：")
                            </div>
                            <div class="col-sm-9">
                                @Html.Bootstrap().TextBoxFor(m => m.Address).AddClass("form-control")
                            </div>
                        </div>

                        <div class="form-group">
                            <div class="col-sm-3 control-label">
                                @Html.LabelFor(m => m.WebSite, "网址：")
                            </div>
                            <div class="col-sm-9">
                                @Html.Bootstrap().TextBoxFor(m => m.WebSite).AddClass("form-control")
                                @Html.ValidationMessageFor(m => m.WebSite)
                            </div>
                        </div>


                        <div class="form-group">
                            <div class="col-sm-3 control-label">
                                @Html.LabelFor(m => m.Blog, "官方微博：")
                            </div>
                            <div class="col-sm-9">
                                @Html.Bootstrap().TextBoxFor(m => m.Blog).AddClass("form-control")
                            </div>
                        </div>

                        <div class="form-group">
                            <div class="col-sm-3 control-label">
                                @Html.LabelFor(m => m.WeChat, "官方微信：")
                            </div>
                            <div class="col-sm-9">
                                @Html.Bootstrap().TextBoxFor(m => m.WeChat).AddClass("form-control")
                            </div>
                        </div>

                        <div class="form-group">
                            <div class="col-sm-3 control-label">
                                @Html.LabelFor(m => m.Email, "官方邮箱：")
                            </div>
                            <div class="col-sm-9">
                                @Html.Bootstrap().TextBoxFor(m => m.Email).AddClass("form-control")
                                @Html.ValidationMessageFor(m => m.Email)
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-sm-3 control-label">
                                @Html.LabelFor(m => m.SerivceUrl, "服务端地址：")
                            </div>
                            <div class="col-sm-9">
                                @Html.Bootstrap().TextBoxFor(m => m.SerivceUrl).AddClass("form-control")
                                @Html.ValidationMessageFor(m => m.SerivceUrl)
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-sm-3 control-label">
                                @Html.LabelFor(m => m.Description, "介绍：")
                            </div>
                            <div class="col-sm-9">
                                @Html.Bootstrap().TextareaFor(m => m.Description).AddClass("form-control").Attribute("rows", "6")
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-sm-offset-3 col-sm-9">
                                @Html.Bootstrap().Button("保存").Style(BootstrapStyle.Primary).Click("SaveFormS('" + @Url.Action("Save") + "');")
                            </div>
                        </div>

                    </form>
                </div>
            </div>
        </div>
    </div>
</section>
<script type="text/javascript">



    function SaveFormS(url) {

        if (false === $("#settingForm").validate().checkForm()) {

            $("#settingForm").valid();
            $("#settingForm button").button('reset');

            return;
        }
        $.ajax({
            type: "POST",
            url: url,
            data: $("#settingForm").serialize(),
            dataType: "json",
            success: function (data) {
                if (data.errors.length > 0) {
                    window.app.message(data.errors);
                }
                else if (data.Success === true) {
                    window.app.message("修改成功");
                    window.app.loadUI('@Url.Action("Index")');
                }
            }
        });
    }
</script>
